<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>02-单向绑定</title>
    <style>
        .active {
            font-weight: bold;
        }
        .text-danger {
            color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <div>{{ msg }} {{ 1+1 }} {{ hello() }}</div>
        <span v-html="msg"></span>
        <span v-text="msg"></span>
        <br/>
        <a v-bind:href="link">Go {{ link }}</a>
        <br/>
        <div v-bind:class="{active: isActive, 'text-danger': isError}">v-bind:class使用</div>
        <div v-bind:style="{color: color, 'font-size': fontSize}">v-bind:style使用</div>
    </div>
    <script src="../node_modules/vue/dist/vue.min.js"></script>
    <script>
        new Vue({
            el: "#app",
            data: {
                msg: "<h1>hello</h1>",
                link: "https://www.gitee.com",
                isActive: true,
                isError: true,
                color: "blue",
                fontSize: "36px"
            },
            methods: {
                hello() {
                    return "Hello World";
                }
            }
        });
    </script>
</body>
</html>